package action.user;

import action.BaseAction;
import service.UserService;
import entity.User;

public class CheckEmailCodeAction extends BaseAction{
	//input
	private String code;
	//output
	private boolean ok=false;
	private User user;
	private String verify_error;
	//injection
	private UserService userService;
	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	public String execute() throws Exception{
		if (userService.checkEmailCode(user, code,session)) {
			return "success";
		}else {
			verify_error="验证失败";
			return "error";
		}
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public boolean isOk() {
		return ok;
	}

	public String getVerify_error() {
		return verify_error;
	}

	public void setVerify_error(String verifyError) {
		verify_error = verifyError;
	}

	public void setOk(boolean ok) {
		this.ok = ok;
	}
	
}
